{% extends "admin/base_site.html" %}

<!-- LOADING -->
{% load i18n adminmedia fb_tags fb_pagination %}

<!-- STYLESHEETS -->
{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
    <link rel="stylesheet" type="text/css" href="{{ settings_var.URL_FILEBROWSER_MEDIA }}css/filebrowser.css" />
{% endblock %}

<!-- JAVASCRIPTS -->
{% block extrahead %}
    {{ block.super }}
    
    {% ifequal query.pop '1' %} <!-- FileBrowseField -->
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_FileBrowseField.js"></script>
    {% endifequal %}
    
    {% ifequal query.pop '2' %} <!-- TinyMCE -->
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_TINYMCE }}tiny_mce_popup.js"></script>
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_TinyMCE.js"></script>
    {% if query.mce_rdomain %}<script language="javascript">document.domain = "{{ query.mce_rdomain }}"</script>{% endif %}
    {% endifequal %}
    
    {% ifequal query.pop '3' %} <!-- CKeditor (former "FCKeditor") -->
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_CKeditor.js"></script>
    {% endifequal %}
    
    {{ media }}
    
    {% if not actions_on_top and not actions_on_bottom %}
    <style>
        #changelist table thead th:first-child { width: inherit; }
    </style>
    {% endif %}
{% endblock %}

<!-- COLTYPE/BODYCLASS -->
{% block coltype %}flex{% endblock %}
{% block bodyclass %}change-list filebrowser{% if query.pop %} popup{% endif %}{% endblock %}

<!-- BREADCRUMBS -->
{% block breadcrumbs %}{% include "filebrowser/default/include/breadcrumbs.html" %}{% endblock %}

<!-- CONTENT -->
{% block content %}
<div id="content-main">
    {% block object-tools %}
    <ul class="object-tools">
        <li><a href="{% url fb_mkdir %}{% query_string '' 'p' %}">{% trans "New Folder" %}</a></li>
        <li><a href="{% url fb_upload %}{% query_string '' 'p' %}" class="focus">{% trans "Upload" %}</a></li>
    </ul>
    {% endblock %}
    <div class="module filtered" id="changelist">
        <div class="changelist-content">
            <div class="result-list-container">
                {% if results_var.results_current %}
                <div class="result-list">
                    <table cellspacing="0">
                        {% include "filebrowser/default/include/tableheader.html" %}
                        <tbody>
                        {% include "filebrowser/default/include/filelisting.html" %}
                        </tbody>
                    </table>
                </div>
                {% endif %}
                {% pagination %}
            </div>
        </div>
        <div id="changelist-filter">
            {% include "filebrowser/default/include/toolbar.html" %}
            <div class="module filter">
                {% include "filebrowser/default/include/filter.html" %}
            </div>
        </div>
    </div>
</div>
{% endblock %}
